﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace io_priactice
{
    class Program
    {
        static void Main(string[] args)
        {
            DriveInfo[] drives = DriveInfo.GetDrives();
            foreach (DriveInfo d in drives)
            {
                if (d.IsReady)
                {
                    Console.WriteLine("总容量：" + d.TotalFreeSpace);
                    Console.WriteLine("可用容量：" + d.AvailableFreeSpace);
                    Console.WriteLine("驱动器类型：" + d.DriveFormat);
                    Console.WriteLine("驱动器的名称：" + d.Name + "\n");
                }
            }
            Console.WriteLine("完成");
            Console.ReadLine();


           
            FileInfo file = new FileInfo(@"F:\\test.txt"); 
            Console.WriteLine(" 创建时间： " + file.CreationTime);
            Console.WriteLine(" 路径： " + file.DirectoryName);
            StreamWriter sw = file.AppendText();
            sw.Write("123456");
            sw.Dispose();
            Console.WriteLine(" 完成！ ");
            Console.ReadLine();
        }
    }
}
